home *** CD-ROM | disk | FTP | other *** search
/ Carousel / CAROUSEL.cdr / mactosh / hc / windoid6.sit / windoid #6.TXT
Encoding:
Text File  |  1988-03-14  |  27.7 KB  |  676 lines  |  [TEXT/MACA]

  1. *****      27722 0
  2. Received: from SUN.COM by WSMR07 ; 11 Mar 88 14:55:06 MST
  3. Received: from plaid.Sun.COM by Sun.COM (4.0/SMI-4.0)
  4.     id AA24667; Fri, 11 Mar 88 09:38:00 PST
  5. Received: by plaid.Sun.COM (3.2/SMI-4.0Beta)
  6.     id AA04060; Fri, 11 Mar 88 09:32:18 PST
  7. Date: Fri, 11 Mar 88 09:32:18 PST
  8. From: hyper-hackers-request%plaid@Sun.COM
  9. Message-Id: <8803111732.AA04060@plaid.Sun.COM>
  10. To: hyper-hackers%plaid@Sun.COM
  11. Subject: WINDOID #6
  12.  
  13. WINDOID #6
  14.  
  15. A Publication for the Informed HyperCard User
  16. and the Newsletter for the Apple HyperCard User Group
  17.  
  18. Editor -- David Leffler
  19.  
  20. IN THIS ISSUE
  21.  
  22. Editorial: HyperCard 1.1
  23. Editors Choice: MacRecorder* by Farallon Computing, Inc.
  24. HyperCard Power Tips Six by Phil Wyman
  25. Gesture by Ted Kaehler
  26. Novice Corner by Phil Wyman
  27. Find Next by Ted Kaehler
  28. HyperCard Utility Scripts by Robin Shank
  29. Scrolling Multiple Fields by Bill Champ
  30. ==========
  31.  
  32. I have had many requests for back issues of WINDOID.  If you would like a copy,
  33. or copies, please send a self-addressed-stamped-envelope-(SASE) to the address
  34. listed on THE FORM for each issue. AHUG does not have a mailing list, so we
  35. cannot put you on ours.  If you would like to receive future issues of WINDOID,
  36. please send SASEs, and I will get them out to you as time allows.
  37. Thank you for your continued interest in WINDOID.
  38.  
  39. ==========
  40.  
  41. Editorial
  42. by David Leffler
  43.  
  44. Well, finally!  Just when people were starting to doubt whether or not WINDOID
  45. #6 would ever appear, here it is.  We have been very busy getting HyperCard 1.1
  46. out the door, and we wanted to make sure that all the Apple dealers and
  47. licensed Apple User Groups had the HyperCard 1.1 Upgrade disk before
  48. publication.  By now, all Apple dealers definitely have the HyperCard 1.1
  49. Update disk in their stores but they are under no obligation to give it to
  50. anyone.  However, Apple dealers are the best and I am sure they will do
  51. everything possible to make sure their customers are satisfied.
  52. HyperCard 1.1 contains many user-requested fixes and enhancements to make your
  53. stack use, and creation, just that much more elegant. It contains a READ ME
  54. FIRST! stack that outlines the new features and updates your Home card with the
  55. new Text Arrows check box and some new Import and Export buttons you have asked
  56. for.  Additionally, there are new and improved internationalized Phone, Area
  57. Codes, and Datebook stacks.   We were going to ship a new Home stack but
  58. recognized that many people had modified their Home cards.  If we shipped a new
  59. Home stack, some people would have dragged the new Home into their HyperCard
  60. Stacks folder and inadvertently replaced their old Home.  We hope you like the
  61. way we make the transition easy for you.  The Text Arrows check box allows you
  62. to choose whether or not you want to use cursor keys in text fields.  With the
  63. box checked you can use your cursor keys to move about in text fields.  If you
  64. then want to go from card to card just press the Option key first.  Naturally,
  65. if the box is not checked, everything works just the way you are used to. For
  66. all of you that sent in requests for features and found for us some of the
  67. problems we fixed for this release, we offer our thanks.  You really made a
  68. quality difference!
  69. If you want the new release, and believe me you do, bring to your Apple dealer
  70. either your original HyperCard Startup, HyperCard & Stacks disks, or the
  71. purchase slip for your Macintosh dated after August 11, 1987, and the Upgrade
  72. is FREE.  Also, if you want to keep your dealer happy, please bring in an
  73. INITIALIZED disk for the upgrade.  They are not going to give disks away.
  74. NOTE:  When we enhanced the 1.1 Datebook stack to work with the international
  75. HyperCard version, there was a modification that makes a small part of the
  76. HyperCard manual tutorial not work properly.  When you try to create the To Do
  77. stack from the Datebook stack, the entire Datebook stack gets created.  This
  78. can be a bit disconcerting. The best thing to do is either copy the To Do card
  79. and paste it into a new empty stack, or just use the old Datebook stack to do
  80. the tutorial.
  81.  
  82. ==========
  83.  
  84. Editors Choice
  85.  
  86. There is a new HyperCard oriented product that I think you should know about.
  87. It is called MacRecorder* from Farallon Computing, Inc.  It is a hand-held
  88. recording device that plugs directly into the serial port on your Macintosh
  89. with no external power supply. One really neat thing about MacRecorder is a
  90. stack called HyperSound*.  This stack allows you to record a sound and, with a
  91. click of a button, install it into any stack complete with its own button.
  92. This is really a fantastic and fun tool for painlessly introducing sounds into
  93. HyperCard stacks.  Additionally, if you have a Macintosh II and two of these
  94. devices, you can record in stereo.
  95.  
  96. One last note to Team HackandSlash in Hawaii: Thank you for your outstanding
  97. contribution to spreading WINDOID around.  I love the format and appreciate the
  98. way you have taken WINDOID issues and turned them into interesting and fun
  99. stacks.  Keep up the good work!
  100.  
  101. ==========
  102.  
  103. HyperCard Power Tips Six
  104.  
  105. by Phil Wyman
  106.  
  107. 1.  Tear off the "Tools" menu. If you double-click on the Eraser tool, you'll
  108. erase all card paint. This can be quite shocking if you do it by mistake. If
  109. this happens to you, either select UNDO from the Edit menu, press the tilde
  110. ( ~ ) key, the escape key, or select CMD-Z from the keyboard before doing
  111. anything else.  This will bring your paint back for you.  If CMD-Z doesn't get
  112. it back, you can try REVERT from the Paint menu.  Revert takes you back to the
  113. state the paint was in when you last entered the card.  Leaving a card, even
  114. for a moment, is the same as saving all the paint elements on that card or
  115. choosing Keep from the Paint menu.
  116. For fun, double-click on all the other powerful paint tools and see what
  117. happens.
  118.  
  119. 2.  To initialize a variable in HyperTalk, you should put the assignment of the
  120. variable in an "on openStack" handler. You will normally only want to
  121. initialize your variables the first time you enter your stack.  If this is so,
  122. you will need to put the following into your openStack handler...
  123.  
  124. on openstack
  125.        global var
  126.        if var is empty then put 12 into var
  127. end openstack
  128.  
  129. This way, no matter how many times the user comes into their stack during a
  130. HyperCard session, the variable "var" will only be assigned this value the
  131. first time, since the second time into the stack the global variable will no
  132. longer be empty.
  133.  
  134. 3.  If you have a non-SCSI (old HD-20) hard disk or, heaven forbid, a floppy
  135. based system, and you have tried to play a long, sophisticated sound in
  136. HyperCard, you might notice very poor sound quality because of numerous clicks
  137. and pops.  These clicks and pops are caused by your disks access time being too
  138. slow when HyperCard tries to access them.
  139. There is, however, a nice workaround (as suggested by Barbara at Farallon
  140. Computing). To stop HyperCard from accessing the disk (doing any processing)
  141. while the sound is playing. Try this in your script...
  142.  
  143. play "nameOfSound"
  144. wait until the sound is "done"
  145.  
  146. 4.  A tip from Paul Foraker...  If the msg box is already open, and you are
  147. typing in a field, there is a way to start typing in the msg box without moving
  148. your fingers from the keyboard. Type CMD-M twice and you can now type in the
  149. msg box.
  150.  
  151. 5.  Tear off the "Tools" windoid. Double click on "A" to access different fonts
  152. and font attributes for typing Paint Text onto the card or background. If you
  153. have already started typing and have not clicked anywhere else, when you change
  154. the font you will change the font for everything you just typed. If you have
  155. already started typing and you wish to change the font only for what you type
  156. next, then click with the mouse at where you want to start before again
  157. double-clicking on the "A" in the tool menu.
  158.  
  159. 6.  "Not" in HyperTalk works similarly to English. Therefore , you can say...
  160.  
  161. if variable is not "Yes" then go next card
  162.  
  163. You may also think of "Not" in HyperTalk as a boolean form of the false
  164. condition. For example you may have a button which you want to alternately hide
  165. and show a field...
  166.  
  167. on mouseup
  168.   set visible of field "fldName" to not visible of field "fldName"
  169. end mouseup
  170.  
  171. 7.  If you protect a stack to allow only the browsing userlevel, you can reset
  172. it to a different level by pressing on the Command key before clicking on the
  173. File menu.  You will then be able to choose "Protect Stack" and reset the
  174. userlevel.
  175.  
  176. ==========
  177.  
  178. Gesture
  179. by Ted Kaehler
  180.  
  181. Use a gesture to get to a button's script, without having to choose the Button
  182. Tool.  The gesture consists of pressing and holding the mouse button down
  183. inside the button, and moving the cursor in and out of the top edge of the
  184. button 2 times!  (Rub the top edge of the button.)
  185.  
  186. Practice until you can do it.
  187.  
  188. (The trick here is to not interfere with anything else.  I don't use the idle
  189. task, it can slow things down.  The whole thing is in the mouseStillDown
  190. message.  If your button uses mouseStillDown, you might want to "pass
  191. mouseStillDown" at the end of your script.)
  192.  
  193. Put this into your Home stack script
  194.  
  195. on mouseStillDown
  196.   --Edits the script of a button if you press and hold the
  197.   --mouse button inside the button, and quickly
  198.   --move in and out of the top edge of the button twice.
  199.   if "button" is not in the name of the target then exit mouseStillDown
  200.   global editTicks, editState
  201.   if (the ticks)-editTicks > 120 then
  202.     put the ticks into editTicks
  203.     put 0 into editState
  204.   else
  205.     get the rect of the target
  206.     if the mouseV < (item 2 of it) then
  207.       if editState = 0 then put 1 into editState
  208.       if editState = 2 then put 3 into editState
  209.     end if
  210.     if the mouseV > (item 2 of it) then
  211.       if editState = 1 then put 2 into editState
  212.       if editState = 3 then put 4 into editState
  213.     end if
  214.   end if
  215.   --put editState
  216.   if editState = 4 then edit script of the name of the target
  217. end mouseStillDown
  218.  
  219. ==========
  220.  
  221. HyperCard Novice Corner
  222.  
  223. by Phil Wyman
  224.  
  225.  
  226. Many novice HyperCard users have asked WINDOID for a beginners tips section.  I
  227. thought about this and remembering that most of the questions asked of me at
  228. the San Francisco MacWorld Expo started with something like "I just bought a
  229. Macintosh and HyperCard came with it.  Could you show me what it does?" I have
  230. therefore decided to begin this column for WINDOID.  If you are a beginning
  231. HypeCard user please use the form at the back of WINDOID to send me your
  232. questions.  I will answer some of the most often asked in this column.
  233.  
  234. When asked "What is HyperCard?" I would normally begin my answer with something
  235. Bill Atkinson said: "HyperCard is a software erector set."  In other words,
  236. HyperCard is a group of tools you can use to easily create your own Macintosh
  237. software applications. The basic tools consist of Buttons, Fields, Graphics,
  238. and Cards. Buttons can complete actions when the user clicks on them, Fields
  239. can hold text for you, and Graphics can create a mood.
  240. A Card is always the exact size of the entire Macintosh Plus screen. When the
  241. screen changes, you normally go to another card.  When you put a few of these
  242. cards together, you have a stack of cards.  Stacks are files that you can copy
  243. to diskettes and give to your friends or sell to others that need them.
  244.  
  245. Your button, field, and graphics tools are in your Tools menu.  You will see
  246. the Tools menu if you are at a high enough "userlevel."  To see the userlevel
  247. you are currently working with, or to change it,  go to the Home card (select
  248. Home from the Go menu), and click the left arrow. You will find yourself on the
  249. Preferences card. Click on the various Userlevels, Browsing through Scripting,
  250. and watch the menubar and Preference card change to reflect your selection.
  251.  
  252. HyperCard contains a language called HyperTalk.  You really don't have to use
  253. HyperTalk to create HyperCard stacks as some people think.  However, once
  254. mastered, HyperTalk will allow you to automatically do almost anything you can
  255. do manually in HyperCard. Some beginning HyperTalk users have trouble because
  256. they think that you have to type all the HyperTalk commands exactly like they
  257. are presented in the on-line Help documentation. This is not so.  HyperTalk is
  258. very forgiving.  For example, the HyperTalk command "doMenu", allows you to
  259. select any menu item automatically (this works for Desk Assessories as well.)
  260. If you use a menu item that is two words long and/or followed by three periods
  261. you will have to put both words and/or the periods between quotes.  If you type
  262. "doMenu Home" into a button script, the next time you click that button, you
  263. will go to the Home Card.
  264.  
  265. on mouseUp
  266.      doMenu Home
  267. end mouseUp
  268.  
  269. on mouseUp
  270.      doMenu "Open Stack..."
  271. end mouseUp
  272.  
  273. However, you don't have to type "doMenu Home" with the capital and lowercase
  274. letters exactly as they appear in the example.  We do this in the documentation
  275. for easier readability. All the following examples will do exactly the same
  276. thing: "domenu home"; "DOMENU HOME"; "doMENU hoME"; or "doMenu Home".
  277. Therefore, you should know that in HyperTalk nothing is case sensitive.  It
  278. never matters whether the words are spelled with an upper or lower case. Even
  279. the "Find" command does not care about letter case-sensitivity. If you try to
  280. Find "TEST" in HyperCard, you will find all occurrences of the word "test"
  281. including "Test"; "test"; "TEST"; and "tesT".
  282.  
  283. Many beginning HyperCard users have been bothered by the fact that sometimes,
  284. when they are typing in a field, the I-beam cursor disappears. They have to
  285. repeatedly click in the field to continue typing.  This is noticeable in the
  286. Home Card or on other Cards where a HyperTalk script updates the time that may
  287. appear in another field. When the script updates the time, the cursor is moved
  288. into that field and is removed from the field you are working in. To fix this,
  289. you either have to use another stack or disable the feature by removing or
  290. inactivating the "On idle" HyperTalk script.  To inactivate a line of any
  291. HyperTalk script you type a double hyphen ( -- ) before the line.
  292.  
  293. A hint for moving between fields on a card is to press the TAB key to go from
  294. field to field.  If you wish to go backwards from field to field, hold the
  295. SHIFT key down and press the TAB key.
  296.  
  297. One really great thing about HyperCard is that it allows non-programmers, the
  298. rest of us, to make full use of our computers without having to become
  299. programmers.  HyperCard allows us to create powerful and meaningful
  300. applications with just buttons, fields, cards, and graphics.  So don't feel as
  301. if you have to learn the HyperTalk language to create your application. Rather,
  302. learn to use the basic tools Macintosh and HyperCard gives you to create a
  303. stack of cards that can help you in your own area of expertise. Just
  304. double-click on "HyperCard" in the finder. You will arrive in the HOME card,
  305. which will be your base of operations.  Click on the buttons to see what they
  306. do. If you get disoriented, you can always choose "Go Home" from the Go menu to
  307. go back to your Home card.  If the menu isn't showing, hold down the Command
  308. key and press the Spacebar to show it again.  I hope you have a wonderful time
  309. using and enjoying HyperCard.
  310.  
  311. ==========
  312.  
  313. FIND NEXT
  314. Civilized searching controlled by your script
  315. by Ted Kaehler
  316.  
  317. The function findNext(theString) goes to the next card containing the string.
  318. It uses the find command because its so fast.  It counts the number of cards
  319. the string has been found on, and lets you do whatever you want on each card it
  320. finds.  findNext keeps track of the first card it found and tells you when
  321. you've gone all the way around the stack.
  322.  
  323. To use findNext, declare "numberFound" to be a global variable.  Set it to
  324. zero.  findNext("Abe") will return true if it found a new card with "Abe" on
  325. it.  It returns false if there are no more cards with "Abe".  Each time,
  326. "numberFound" has the number of cards "Abe" was found on.
  327.  
  328. Example:  Put this into your button script.
  329.  
  330.  
  331. on mouseUp
  332. --an example of using findNext()
  333. --count the number of cards with a word starting with "Abe" or whatever
  334.   global numberFound
  335.   put 0 into numberFound
  336.   repeat while findNext("Abe") --"Abe" or whatever you choose
  337.   end repeat
  338.   put "Found on" && numberFound && "cards" into message
  339. end mouseUp
  340.  
  341. Put this into your stack script.
  342.  
  343. function findNext key
  344.   --fast searching of a stack under program control.  see example.
  345.   --return true if we found a new occurance, false if done
  346.   --numberFound will have the total we have found
  347.   global numberFound, firstFound
  348.   if (numberFound = 0) or (firstFound is empty)
  349.   then return findFirst(key)
  350.  
  351.   go next card
  352.   find key
  353.  
  354.   if the result is "not found" then
  355.     put empty into firstFound
  356.     return false
  357.   end if
  358.  
  359.   if the ID of this card <> firstFound then
  360.     add 1 to numberFound
  361.     return true   --we found another occurance
  362.   else  --we wrapped around the stack
  363.     put empty into firstFound
  364.     return false
  365.   end if
  366. end findNext
  367.  
  368. function findFirst key
  369.   --only called by findNext (not called by user)
  370.   --because numberFound = 0, we know this is the first time
  371.   global numberFound, firstFound
  372.   if numberFound <> 0 then
  373.     ask "You must put 0 into numberFound before calling findNext()" with "OK"
  374.     return false
  375.   end if
  376.  
  377.   find key
  378.  
  379.   if the result is "not found" then
  380.     put empty into firstFound
  381.     return false
  382.   else   --we found it
  383.     put the ID of this card into firstFound
  384.     put 1 into numberFound
  385.     return true
  386.   end if
  387. end findFirst
  388.  
  389. You can put findNext() and its subroutine, findFirst(), into your home script.
  390. If you have stricter conditions on the cards you want to find, do your tests on
  391. each card that findNext finds.
  392.  
  393. ==========
  394.  
  395. HyperCard Utility Scripts:
  396. By Robin Shank
  397.  
  398. The following is a small collection of utility scripts that I find useful in my
  399. work.
  400.  
  401. Finding the Finder
  402. When running under MultiFinder, the following script will hide the HyperCard
  403. window, the Message window, and any tearoff windoids and put you in the Finder.
  404. It is handy when installed into a button on the Home card, especially when you
  405. are working on a small-screen Mac.  When you choose HyperCard from the Apple
  406. menu, the HyperCard windows will reappear exactly as you left them.  Note:
  407. Hide/Show card window is a new feature of version 1.1, so you must be running
  408. that version for this script to work.
  409.  
  410. on mouseUp
  411.   hide card window
  412.   doMenu "finder"
  413. end mouseUp
  414.  
  415. The following is another handy script that uses hide/show card window.  This
  416. utility allows you to toggle between settings for small and large screen Macs.
  417. One useful example is to put the word "setWindow" under "StartUp" in your Home
  418. Stack script and put the following script at the end.  When you first open
  419. HyperCard you can have your windows right where you want them.
  420.  
  421. on setWindow
  422.   answer "Which CPU?" with "Mac II" or "Mac +"
  423.   if it is "Mac II" then
  424.     show menuBar
  425.     show card window at 20,50
  426.     show tool window at 524,198
  427.     show message window at 0,370
  428.   else if it is "Mac +" then
  429.     show card window at 0,0
  430.     hide tool window
  431.     hide pattern window
  432.     show msg at 30,260
  433.     hide msg
  434.   end if
  435. end setWindow
  436.  
  437.  
  438. Recovering lost buttons
  439. Well, this script won't recover anything you've already lost, but it may save
  440. you a headache in the future.  Put this script in the Home stack script. When
  441. ever you try to get rid of a button this script will complain and give you the
  442. chance to get your button back.
  443.  
  444. on deleteButton
  445.   answer "Do you REALLY want to delete that button?" B
  446.   with "No, Copy it" or "Yes"
  447.   if it is "No,Copy it" then
  448.     doMenu "copy button"
  449.     doMenu "paste Button"
  450.   end if
  451. end DeleteButton
  452.  
  453. Changing a button's font style
  454. Yes, there are alternatives to those generic round rect buttons with text in
  455. good ol' Chicago.  Buttons can be assigned a font and font style through a
  456. script.  If you wish to change the font of a single button, just type
  457. set the textFont of card button "fred" to "Geneva"
  458. into the message box, and hit return.  In addition, you can set the size (set
  459. textSize...), style (set textStyle...) alignment (set TextAlign...), and height
  460. (set textHeight...),  of any button.  My current personal favorite is a
  461. shadowed button with 10 point Geneva text.
  462.  
  463. Once you get the hang of changing the text-related attributes of buttons, it
  464. can get a bit tedious to set all these styles by typing lines into the msg box.
  465. The following script installed into a functionKey and invoked from the message
  466. box can be a real finger saver.  It will change the button you specify to your
  467. choice of font, font size, and font style.
  468.  
  469. on ChangeButton
  470.    ask "Which button?" with "Card button ID " & id of last button
  471.    if it is empty then exit ChangeButton
  472.    put it into btnname
  473.  
  474.    ask "Font, Size, Style?" with "Geneva,9,bold"
  475.    if it is empty then exit ChangeButton
  476.  
  477.    if first item of it is not empty
  478.    then do "set textFont of " & btnname & " to " & first item of it
  479.  
  480.    if item 2 of it is not empty
  481.    then do "set textSize of " & btnname & "to " & item 2 of it
  482.  
  483.    if item 3 of it is not empty
  484.    then do "set textStyle of " & btnname & "to " & item 3 of it
  485.  
  486. end changeButton
  487.  
  488. Invoking this script will present two dialogs.  In the first dialog, enter the
  489. full name of any button on that card.  Remember to specify card or background
  490. button, and refer to it by name, id or number. (bkgnd btn "New button".)  In
  491. the second dialog, enter the font, size and style, separated by commas.  If you
  492. do not wish to change one of the attributes, leave it blank (font, ,style) or
  493. enter what it currently is set to.
  494.  
  495. An alternative solution:
  496. Locked fields can behave just like buttons.  Create a field, enter your title
  497. into it, choose your text style through the Textstyle window, then lock the
  498. field.  You can now put any "mouse" handler (on mouseUp,etc) into the script of
  499. this field and it will behave just like a rect button, with the exception of
  500. hiliting.
  501.  
  502. Which line did I click on?
  503. The following function scripts return which line of a field was clicked on. In
  504. this case, "line" is defined as the number of textHeight increments from the
  505. top of the field, and not as a line of text ending with a carriage return.
  506. Also, the field needs to be locked when you click on it, or you will end up
  507. putting an insertion point in the field, not executing a script.
  508.  
  509. A simple example of how this might be useful:
  510. Put the following handler as well as one of the functions into the script of a
  511. field.  The field should be locked and contain some lines of text that do not
  512. wrap.
  513.  
  514. on mouseUp
  515.   answer "You clicked on line " & quote & line lineclicked()B
  516.   of card field "newt" & quote
  517. end mouseUp
  518.  
  519. function lineClicked
  520.   return ((the mouseV - item 2 of the rect of the target) B
  521.   div the textHeight of the target) + 1
  522. end lineClicked
  523.  
  524. If you wish this to work on a scrolling field, it becomes a bit more complex to
  525. account for the possiblity of lines scrolled off the top.
  526.  
  527. function lineClicked
  528.   return (round((the scroll of the target / the textHeightB
  529.   of the target) B
  530.   +  (((the mouseV - item 2 of the rect of the target) B
  531.   div the textHeight of the target) + 1)))
  532. end lineClicked
  533.  
  534.  
  535. AutoCompaction will keep your stacks trim
  536. Install this script into your Home stack script. If any stack you are about to
  537. leave needs to be compacted, it will let you know.  This is an easy way to
  538. ensure you always have lots of room on your hard disk (...for more stacks.)
  539.  
  540. on closeStack
  541.   if the freeSize of this stack >= 15000 then
  542.     answer "This stack has " & round(the freeSize of thisB
  543.        stack/1024) & "k free, Compact?" with  "NO" or "OK"
  544.     if it is "OK" then doMenu "compact stack"
  545.   end if
  546. end closeStack
  547.  
  548. ==========
  549.  
  550. Scrolling Multiple Fields
  551. by Bill Champ
  552.  
  553. WINDOID is great! It has been a big help to see those example scripts and learn
  554. new features and tricks. Especially things that are not shown in Goodman's book
  555. (Ed: Danny Goodman - The Complete HyperCard Handbook - Bantam) or other places.
  556. Since I've learned so much from WINDOID, I'd like to share a script with the
  557. other readers.
  558.  
  559. How can you get several scrollable fields to all scroll together?
  560.  
  561. Put these two handlers in your card script.
  562.  
  563. On openCard
  564.   global initScroll
  565.   put 0 into initScroll
  566.   repeat with i = 2 to 5
  567.     set the scroll of card field i to initScroll
  568.   end repeat
  569. end openCard
  570.  
  571. The script above simply sets all the scrollable fields you want (in this case
  572. fields 2 thru 5) to zero - elevator at the top of the scroll bar.  It also
  573. stores that scroll value (zero) in a global variable (initScroll).
  574.  
  575. on updateScroll
  576.   global initScroll
  577.   repeat with i = 2 to 5
  578.     set the scroll of card field i to initScroll
  579.   end repeat
  580. end updateScroll
  581.  
  582. This is the workhorse script. It sets the scroll of the fields you want, all
  583. equal to the variable initScroll. initScroll gets changed by the user scrolling
  584. one of the fields. That's what the next script does.
  585.  
  586. Put the following script in each of the scrollable fields.
  587.  
  588. on mouseWithin
  589.   global initScroll
  590.   if the scroll of me <> initScroll then
  591.     get the scroll of me
  592.     put it into initScroll
  593.     updateScroll
  594.   end if
  595. end mouseWithin
  596.  
  597. The above script detects changes in a field's scroll bar and changes the value
  598. of the global variable initScroll.  Then it calls the updateScroll script (on
  599. the card) to change all appropriate fields to the same value.
  600.  
  601. These scripts are great for creating tabular style fields that can scroll and
  602. yet keep all the info lined up between fields.  It helps to layout the fields
  603. evenly horizontal on the card.
  604.  
  605. ==========
  606.  
  607. We hope you have enjoyed reading this latest issue of WINDOID and have found it
  608. to be interesting and informative. We care enough to take the time to give you
  609. the most up-to-date information about HyperCard, and we would like to make a
  610. request for a little of your time. There is a form that follows this editorial;
  611. please fill it out if you will. We are very interested in hearing from you.
  612. What sort of stacks are you using, what kind of stacks are you creating, and
  613. what are your joys and frustrations in using HyperCard.
  614.  
  615. You have the unique opportunity to communicate directly with Bill, Dan, and the
  616. entire HyperCard development team. We really want to know what you would like
  617. to see in HyperCard and are more than willing to give you what you want. What
  618. we need to make this happen is your input. Let us know what you think. We can
  619. address it in WINDOID or perhaps the next revision of HyperCard. You can make a
  620. difference in the world by communicating with us. DonUt pass up the
  621. opportunity!
  622.  
  623. ==========
  624.  
  625. If you have a bug, suggestion, comment, or just want to know the best way to do
  626. something in HyperCard, you can fill out the form and send
  627. it to:
  628.  
  629. AHUG c/o David Leffler
  630. Apple Computer, Inc.
  631. MS/27-AQ
  632. 20525 Mariani Ave.
  633. Cupertino, CA 95014
  634.  
  635. Or copy the format and
  636. Apple-Link* it to:
  637. HYPERBUG$
  638.  
  639.  
  640. TELL HYPERCARD
  641. You can use this form to notify the HyperCard team of problems, bugs, and
  642. enhancement requests.
  643.  
  644. THE FORM:
  645.  
  646. Please use the following form to make a difference in the world:
  647.  
  648. Date:
  649. Name:
  650. Address:
  651. Phone #:
  652. Versions of:
  653.  a.  HyperCard:
  654.  b.  Associated software:
  655.  c.  System Software:
  656.      1. System
  657.      2. Finder
  658.      3. ImageWriter file
  659.      4. LaserWriter file
  660.      5. Any others
  661. Type of Macintosh:
  662. Peripherals:
  663. Description of problem, suggestions or comments:
  664.  
  665.  
  666. If you have some information for us please fill this form out as completely as
  667. possible and send it to us.  You will be glad you did!
  668.  
  669.  
  670.  
  671.  
  672. ----------------------------------------
  673. Submissions to: hyper-hackers@plaid.sun.com
  674. Administrivia to: hyper-hackers-request@plaid.sun.com
  675. UUCP: {decwrl,hplabs,ihnp4}!sun!plaid!hyper-hackers{-request}
  676.